import { guideMgr } from "./guideMgr";
import { IGuideConfig } from "./iGuide";

export class guideCenter {

    private static _guideCfgMap: Map<number, IGuideConfig> = new Map<number, IGuideConfig>();

    static triggerGuide(guideId: number) {
        guideMgr.Inst.triggerGuide(guideId);
    }

    static cancelGuide(guideId: number) {
        guideMgr.Inst.cancleGuide(guideId);
    }

    static getGuide(id: number): IGuideConfig {
        if (!this._guideCfgMap.has(id)) {
            console.error(`未注册当前引导：${id}`);
            return null;
        }
        return this._guideCfgMap.get(id);
    }

    static registerGuide(cfg: IGuideConfig) {
        if (this._guideCfgMap.has(cfg.id))
            return;

        this._guideCfgMap.set(cfg.id, cfg);
    }
}


